<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <router-link :to="{'name':'aaa',params:{'stu_name':'aaaaaa'}}">aaa</router-link>
    <router-link :to="{'name':'bbb',params:{'stu_name':'bbbbbb'}}">bbb</router-link>
    <router-link :to="{'name':'ccc',params:{'stu_name':'cccccc'}}">ccc</router-link>
    <hr/>
    <router-view></router-view>
</div>
</body>
</html>
<script src="../js/vue.min.js"></script>
<script src="../js/vue-router.js"></script>
<script>
    let aaa = {
        data() {
            return {
                content: ''
            }
        },
        mounted() {
            this.content = this.$route.params.stu_name
        },
        template: `
          <div>
            <h3>我是组件aaa</h3>
            {{ content }}
          </div>
        `
    }
    let bbb = {
        data() {
            return {
                content: ''
            }
        },
        mounted() {
            this.content = this.$route.params.stu_name
        },
        template: `
          <div>
            <h3>我是组件bbb</h3>
            {{ content }}
          </div>
        `
    }
    let ccc = {
        data() {
            return {
                content: ''
            }
        },
        mounted() {
            this.content = this.$route.params.stu_name
        },
        template: `
          <div>
            <h3>我是组件ccc</h3>
            {{ content }}
          </div>
        `
    }

    let router = new VueRouter({
        routes: [
            {
                path: '/aaa/:stu_name',
                name: 'aaa',
                component: aaa
            },
            {
                path: '/bbb/:stu_name',
                name: 'bbb',
                component: bbb
            },
            {
                path: '/ccc/:stu_name',
                name: 'ccc',
                component: ccc
            }
        ]
    })
    new Vue({
        el: '#app',
        data() {
            return {}
        },
        components: {
            aaa, bbb, ccc
        },
        router
    })
</script>